﻿<?php
/**
 * Template Name: Home page
 *
 * This is the template that displays all pages by default.
 * Please note that this is the WordPress construct of pages
 * and that other 'pages' on your WordPress site will use a
 * different template.
 *
 * @package WordPress
 * @subpackage Twenty_Ten
 * @since Twenty Ten 1.0
 */

get_header(); ?>

		<div id="container">
			<div id="content" role="main">
			
			
				<div class="box_content">
						<?php
						 $idObj = get_category_by_slug('home-page'); 
						 $catname= $idObj->name;
	  						$catid = $idObj->term_id;
						$abc= query_posts('cat='.$catid.'&showposts=3');
						//var_dump($abc);
						?>
						
						 <div class="content-home">
						 <?php foreach ($abc as $i => $value) {?>
	    						<div class="fitem">
						            <div class="img img1"><?php echo get_the_post_thumbnail($abc[$i]->ID, 'full'); ?></div>
						            <div class="text">
						                <h2 style="font-size:12px;"><a class="name" title="<?php echo  $abc[$i]->post_title;?>" href="<?php echo $abc[$i]->guid; ?>"><?php echo  $abc[$i]->post_title;?></a></h2>
						                <div class="content-hh"><p style="text-align: justify;"><span style="color: rgb(255, 153, 0);"><strong>[TheGioiNhan]</strong></span><?php echo $abc[$i]->post_excerpt; ?></p></div>
										<div class="xemchitiet"> <a class="next" title="Xem thêm" href="<?php echo $abc[$i]->guid; ?>">Xem thêm...</a></div>
						            </div>
					        	</div>
						 
						 <?php }?>
						 </div>
						 <?php wp_reset_query();?>
				</div>

			<?php
			/* Run the loop to output the page.
			 * If you want to overload this in a child theme then include a file
			 * called loop-page.php and that will be used instead.
			 */
			//get_template_part( 'loop', 'page' );
			?>

			</div><!-- #content -->
		</div><!-- #container -->

<?php get_sidebar(); ?>
<?php get_footer(); ?>
